var express = require('express')
var { expressjwt } = require('express-jwt')
var { expressjwt } = require('express-jwt')
var app = express()
app.use(express.static('static'))
app.use(express.json())
app.use(express.urlencoded({ extended: false }))
app.use(expressjwt({
    secret: '1234',//密钥
    algorithms: ['HS256'], //算法
}).unless({ path: ['/user/login', '/user/register','/user/add'] }));
var userRouter = require('./router/userRouter')
app.use('/user', userRouter)
app.listen(8080, () => {
    console.log('服务端运行在：http://localhost:8080');
})
